package com.example.easytts.model

import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import com.fasterxml.jackson.module.kotlin.readValue
import java.io.File

object AzureVoices {
    private val json: Map<String, Any> by lazy {
        val resource = Thread.currentThread().contextClassLoader.getResource("AzureVoices.json")
        requireNotNull(resource) { "AzureVoices.json not found in resources" }
        jacksonObjectMapper().readValue(resource.readText())
    }
    val languages: List<String> by lazy {
        @Suppress("UNCHECKED_CAST")
        json["languages"] as? List<String> ?: emptyList()
    }
    val voiceData: Map<String, Any> by lazy {
        @Suppress("UNCHECKED_CAST")
        json["voiceData"] as? Map<String, Any> ?: emptyMap()
    }
} 